<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <ui:composition template="/templates/mainTemplate.xhtml">
            <ui:define name="content">
                <h:form>
                    <h:panelGrid columns="3">
                        <h:outputText value="Find Applicant by Email: "/>
                        <p:inputText id="email" value="#{staffPageBean.email}"/>
                        <p:commandButton value="Find" update="messages,resultspanel" action="#{staffPageBean.findApplicantByEmail}"/>  
                        <p:messages id="messages" />
                    </h:panelGrid>
                    <p:outputPanel id="resultspanel">
                        <p:panel rendered="#{staffPageBean.resultsRendered}" id="results" header="Results">
                            <h:panelGrid columns="2" columnClasses="label, value" styleClass="grid">
                                <h:outputText value="First Name:"/>
                                <h:outputText value="#{staffPageBean.applicant.firstName}"/>
                                <h:outputText value="Last Name:"/>
                                <h:outputText value="#{staffPageBean.applicant.lastName}"/>
                                <h:outputText value="Application Status:"/>
                                <h:outputText value="#{staffPageBean.status}"/>
                                <h:outputText value="Application Evaluation:"/>
                                <h:outputText value="#{staffPageBean.evaluation}"/>
                                <h:outputText value="Override application status:"/>
                                <h:outputText value="Override evaluation:"/>
                                <h:panelGroup>
                                    <p:selectOneMenu value="#{staffPageBean.status}">  
                                        <f:selectItem itemLabel="Submitted" itemValue="SUBMITTED" />  
                                        <f:selectItem itemLabel="Unsubmitted" itemValue="UNSUBMITTED" />  
                                    </p:selectOneMenu>
                                    <p:commandButton ajax="false" value="Submit" action="#{staffPageBean.overrideStatus()}">
                                    </p:commandButton>
                                </h:panelGroup>
                                <h:panelGroup>
                                    <p:selectOneMenu value="#{staffPageBean.evaluation}">  
                                        <f:selectItem itemLabel="PASS" itemValue="PASS" />  
                                        <f:selectItem itemLabel="FAIL" itemValue="FAIL" />  
                                        <f:selectItem itemLabel="INCONCLUSIVE" itemValue="INCONCLUSIVE" />  
                                    </p:selectOneMenu>
                                    <p:commandButton ajax="false" value="Submit" action="#{staffPageBean.overrideEvaluation()}">
                                    </p:commandButton>
                                </h:panelGroup>

                                <p:commandButton ajax="false" value="Go To Application" action="#{staffPageBean.goToApplication()}">
                                </p:commandButton>

                            </h:panelGrid>
                        </p:panel>
                    </p:outputPanel>
                </h:form>
            </ui:define>
        </ui:composition>
    </h:body>
</html>

